package com.designpattern.createpattern.demo07.builder.director;

import com.designpattern.createpattern.demo07.builder.builder.Builder;
import com.designpattern.createpattern.demo07.builder.product.Bike;

/**
 * 指挥者类
 */
public class Director {
    private Builder builder;

    public Director(Builder builder) {
        this.builder = builder;
    }

    /**
     * 组装自行车
     * @return
     */
    public Bike construct() {
        builder.buildFrame();
        builder.buildSeat();
        return builder.createBike();
    }
}
